package exception;

public class TryCatchDemo {

    public static void main(String[] args) {

        String line = null;
        try{
            int len = line.length();
        }catch (NullPointerException e){
            line = "good";
            System.out.println("异常处理完毕");
        }
        int len = line.length();
        System.out.println("字符串的长度为："+len);

    }

}
